package com.huage_03;

public class StringDemo02 {
    public static void main(String[] args) {
        char[] chs = {'a','b','c'};
        String s1 = new String(chs);
        String s2 = new String(chs);

        String s3 = "abc";
        String s4 = "abc";

        //比较两个字符串地址是否相同
        System.out.println(s1==s2);//false
        System.out.println(s1==s3);//false
        System.out.println(s3==s4);//true
        System.out.println("----------");

        //比较两个字符串内容是否相同
        System.out.println(s1.equals(s2));//true
        System.out.println(s1.equals(s3));//true
        System.out.println(s3.equals(s4));//true
    }
}
